{include file='fcworker/fc_head'}
<style>
    .sub-div{
        width: 100%;
        text-align: center;
        margin: 0 auto;
    }
    .sub-btn{
        width: 184px;
        height: 35px;
        background-color: #5c99f7;
        border-radius: 50px;
        border: 0;
        margin-top: 20px;
        color: #fff;
        font-size: 15px;
        font-weight: 400;
    }
</style>
<body style="background:#f8f8f8">
<div id="mescroll" class="mescroll">
    <div id="app">
        <div class="setTitle_h">
            <a href="javascript:history.back(-1)"></a>
            活动虚拟数据
        </div>
        <form id="myform3">
            <div class="setActive">
                <ul>
                    <li>
                        <p>统计数据模式（不建议修改）</p>
                        <div class="choseBar2">
                            <span class="{php echo $config['touxiang']==0?'on':'';}" data-value="0">打开的客户</span>
                            <span class="{php echo $config['touxiang']==1?'on':'';}" data-value="1">填写姓名电话的</span>
                            <span class="{php echo $config['touxiang']==3?'on':'';}" data-value="3">支付的客户(显示昵称）</span>
                            <span class="{php echo $config['touxiang']==2?'on':'';}" data-value="2">支付的客户(显示姓名：推荐）</span>
                        </div>
                        <input type="hidden" name="touxiang" id="touxiang" value="{$config['touxiang']}">
                    </li>
                    <li>
                        <p>{php echo $config['ruanjian']==5?'虚拟砍价成功':'虚拟报名人数';} （当前真实数：{$config['totalsum']}）</p>
                        <input  name="fakejoin" type="number" value="{$config['fakejoin']}">
                    </li>
                    <li>
                        <p>虚拟参与人数（当前真实数：{$config['groupsnum']}）</p>
                        <input name="faketuan" type="number" value="{$config['faketuan']}">
                    </li>
                    <li>
                        <p>虚拟浏览（当前真实数：{$config['scannum']}）</p>
                        <input name="fakescan" type="number" value="{$config['fakescan']}">
                    </li>
                    {if $config['yaoyiyao']}
                    <li>
                        <p>摇一摇:虚拟人数（当前真实数：{$config['commyaoyiyao']}）</p>
                        <input name="comm7num" type="number" value="{$config['comm7num']}">
                    </li>
                    <li>
                        <p>摇一摇:虚拟钱数（当前真实数：{$config['commyaoyiyaofee']}）</p>
                        <input name="comm7fee" type="number" value="{$config['comm7fee']}">
                    </li>
                    {/if}
                </ul>
            </div>
            <div class="sub-div">
                <button class="sub-btn" id="sub3" type="button">提交</button>
            </div>
        </form>
        {include file='fcworker/fc_foot_yixuan'}
        <div class="h110"></div>

    </div>
</div>
{include file='fcworker/fc_foot'}
</body>
<script>
    const mescroll = new MeScroll("mescroll", {
        down: {
            auto: false,
            callback: () => {
                mescroll.endSuccess();
                setTimeout(() => {
                    window.location.reload();
                },500)
            }
        },
        up: {
            use: false
        }
    })
    $('.choseBar2 span').click(function(){
        var touxiang = $(this).data("value");
        $("#touxiang").val(touxiang);
        $(this).addClass('on').siblings().removeClass('on');
    })
    $('.moreChose span').click(function(){
        if($(this).hasClass('on')){
            $(this).removeClass('on')
        }else{
            $(this).addClass('on')
        }
    });
    $("#sub3").click(function () {
        var formData3 = $("#myform3").serializeArray();
        let datalist = {};
        $.each(formData3,function (index,item) {
            datalist[item.name] = item.value;
        });
        datalist['op'] = 'save';
        var postUrl="/{php echo createMobileUrl('X_setxuni',array('themeid'=>$themeid));}";
        $.ajax({
            url:postUrl,
            dataType:'json',
            method:'post',
            data: datalist,
            success:function (e) {
                let data = e.data;
                let error = e.error;
                let msg = e.msg;
                if (error){
                    layer.msg(msg);
                    return;
                }else{
                    layer.msg('保存成功');
                    self.location.href = postUrl;
                }
            },
            fail:function (err) {
            }
        });
    });
</script>
</html>